package com.hydl.power.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import com.hydl.power.service.PowerDataNewService;
import com.hydl.power.utils.Resp;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**
 * @author Miss
 * @description 电表数据
 * @date 2023-01-07
 */
@RestController
@RequestMapping(value = "/powerDate")
@Api(value = "PowerDateController", tags = "电表数据管理")
@CrossOrigin
public class PowerDataController {

    @Autowired
    private PowerDataNewService powerDataNewService;

    /**
     * 查询电表数据
     *
     * @author Miss
     * @date 2023/01/07
     **/
    @ApiOperation("查询电表数据")
    @PostMapping("/queryPowerData")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备编码",defaultValue = "" ,dataType = "String"),
        @ApiImplicitParam(paramType = "query", name = "time", value = "时间",defaultValue = "2023-01-14",dataType = "String"),
        @ApiImplicitParam(paramType = "query", name = "dataType", value = "类型",defaultValue = "",dataType = "String"),
        @ApiImplicitParam(paramType = "query", name = "minute", value = "分",defaultValue = "10",dataType = "String"),
    })
    public Resp queryPowerData(String deviceId, String time, String dataType,String minute){
        return Resp.success(powerDataNewService.queryPowerData(deviceId,time,dataType,minute));
    }


}